
/*服务中心广告效果*/
$(function(){
     var len  = $(".num > li").length;
	 var index = 0;
	 var adTimer;
	 $(".num li").mouseover(function(){
		index  =   $(".num li").index(this);
		showImg(index);
	 }).eq(0).mouseover();	
	 //滑入 停止动画，滑出开始动画.
	 $('.ad').hover(function(){
			 clearInterval(adTimer);
		 },function(){
			 adTimer = setInterval(function(){
			    showImg(index)
				index++;
				if(index==len){index=0;}
			  } , 2000);
	 }).trigger("mouseleave");
})
// 通过控制top ，来显示不同的幻灯片
function showImg(index){
        var adHeight = $(".content_right .ad").height();
		$(".slider").stop(true,false).animate({top : -adHeight*index},1200);
		$(".num li").removeClass("on")
			.eq(index).addClass("on");
}
	


//全局页面适应

        var jsVer = 28;

        var phoneWidth = parseInt(window.screen.width);

        var phoneScale = phoneWidth / 640;


        var ua = navigator.userAgent;

        if (/Android (\d+\.\d+)/.test(ua)) {

            var version = parseFloat(RegExp.$1);

            // andriod 2.3

            if (version > 2.3) {

                document.write('<meta name="viewport" content="width=640, minimum-scale = ' + phoneScale + ', maximum-scale = ' + phoneScale + ', target-densitydpi=device-dpi">');

                // andriod 2.3以上

            } else {

                document.write('<meta name="viewport" content="width=640, target-densitydpi=device-dpi">');

            }

            // 其他系统

        } else {

            document.write('<meta name="viewport" content="width=640, user-scalable=no, target-densitydpi=device-dpi">');

        }